package com.silence.springboot.controller;

import com.silence.springboot.common.Result;
import com.silence.springboot.entity.AuthorInfoEntity;
import com.silence.springboot.service.AuthorInfoService;
import com.silence.springboot.vo.input.SelectAuthorInput;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 作者信息表 控制层。
 *
 * @author mybatis-flex-helper automatic generation
 * @since 1.0
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/author/admin")
@Tag(name = "作者信息", description = "作者信息 控制层")
public class AuthorInfoController {

    /**
     * 作者信息表 服务层
     */
    private final AuthorInfoService authorInfoService;

    /**
     * 查询作者信息
     *
     * @param input 登录表实体类
     */
    @PostMapping("/selectAuthor")
    @Operation(summary = "查询作者信息", description = "查询作者信息")
    public Result<List<AuthorInfoEntity>> selectAuthor(@Validated @RequestBody SelectAuthorInput input) {
        // 返回成功
        return Result.success(authorInfoService.selectAuthor(input));
    }

}